package Tracker.Data.DataBase;

import java.io.IOException;
import java.sql.SQLException;

import common.Content;
import common.User;


public class DataBaseTestClass {

	public static void main(String[] args) throws SQLException, IOException, ClassNotFoundException {
		
		//connection	
		ConnectionToDataBase.loadDriver();
			
		ConnectionToDataBase.makeConnection();
			
		ConnectionToDataBase.createTable();
		
			
		//users
		User user1 = new User("user1","user1");
		
		ConnectionToDataBase.AddUser(user1);
		
		User user2 = new User("user2","user2");
		
		ConnectionToDataBase.AddUser(user2);
		
		System.out.println(ConnectionToDataBase.GetAllUsers());
		
		ConnectionToDataBase.RemoveUser("user1");
		
		System.out.println(ConnectionToDataBase.GetAllUsers());

		//contents
		Content content1 = new Content("content1");
		
		ConnectionToDataBase.AddContent(content1);
		
		Content content2 = new Content("content2");
		
		ConnectionToDataBase.AddContent(content2);
		
		System.out.println(ConnectionToDataBase.GetAllContents());

		ConnectionToDataBase.RemoveContent("content1");
		
		System.out.println(ConnectionToDataBase.GetAllContents());

	}
	
}
